<?php

namespace App\Http\Controllers\home;

use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;
use DB;
class NoticeController extends Controller
{
     public function getIndex(Request $request)
    {
    	  if(session('web') == 2){
        // 关闭状态
        $webconfig = DB::table('webconfig') -> first();
        return view('home/webconfig/index',['webconfig'=> $webconfig]);
       }else{
       	 	 
    // 对查询语句构造器进行分页  paginate  查询数据并且分页
     
        $data = DB::table('notice') ->get();
        return view('/home/notice/index ',['data'=>$data]);

       //return view('/home/notice/index');
       }
       
    }
	 public function getAbc(Request $request){
     $id = $request->input('id');
     // 获取轮播图
     $goods = DB::table('goods') -> get();
     // dd($goods);
      //查询单条数据
      $data = DB::table('notice') -> where('id',$id) -> first();
      return view('home/notice/xiangxi',['data'=>$data,'goods'=>$goods]);
   }
}
